import Vue from 'vue'
import App from './App.vue'
import Vant from 'vant';
import 'vant/lib/index.css';
import router from './router/index.js'
import axios from 'axios'


//引入字体iconfont
import './assets/style/iconfont.css'
//引入主题样式
import './assets/style/theme.less'
//引入reset.css
import './assets/style/reset.css'
//解决300ms延时
import FastClick from 'fastclick'
FastClick.attach(document.body)


// axios.defaults.baseURL=''
//挂在axios

//本地配置
// let config={
//   baseURL:'http://192.168.1.153:3000/'
// }
// Vue.prototype.$ws='192.168.1.153'
// Vue.prototype.$baseUrl='http://192.168.1.153:3000/'

//本地配置
let config={
  baseURL:'http://43.143.55.122:3000'
}
Vue.prototype.$ws='43.143.55.122'
Vue.prototype.$baseUrl='http://43.143.55.122:3000/'

//云服务
// let config={
//   baseURL:'http://120.79.73.9:3000/'
// }
// Vue.prototype.$ws='120.79.73.9'
// Vue.prototype.$baseUrl='http://120.79.73.9:3000/'


Vue.prototype.$http=axios.create(config)
Vue.prototype.$http.interceptors.request.use(config => {
  //配置token
  if (localStorage.getItem('token')) {
    config.headers['Token'] = localStorage.getItem('token');
  }
  return config;
}, error => {
  return Promise.reject(error);
})


Vue.use(Vant);
Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
